package com.bafa.front;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bafa.dbcache.LeagueCache;
import com.bafa.exceptions.ErrorException;
import com.bafa.objects.PageBean;
import com.bafa.objects.User;
import com.bafa.services.LogonServices;

public class LogoutServlet extends DaddyServlet {

	
	@Override
	public void doEvent(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ErrorException {
		HttpSession session = request.getSession();
		Cookie cookie = new Cookie( "bafaloggedon", "" );
		cookie.setMaxAge(0);
		response.addCookie(cookie);
		session.removeAttribute("LOGGEDON");
		session.removeAttribute("LOGGEDONTEAM");
		session.removeValue("LOGGEDON");
		session.removeValue("LOGGEDONTEAM");
		
		url = "master";
	}
}
